package com.yihaodian.search.broker.shard;

import com.yihaodian.api.common.Request;
import com.yihaodian.api.search.SearchRequest;

public class ShardSearchRequest extends Request {
	/**
	 * 
	 */
	private static final long serialVersionUID = -773271181453795016L;

	/**
	 * if a request is redirected more than 3 times. we may reject directly.
	 */
	private int redirectCnt = 0;

	private String shardId;

	private SearchRequest searchRequest;

	protected ShardSearchRequest() {

	}

	public ShardSearchRequest(String shardId, SearchRequest searchRequest) {
		super(searchRequest.getIndexName());
		this.shardId = shardId;
		this.searchRequest = searchRequest;
	}

	public String getShardId() {
		return shardId;
	}

	public void setShardId(String shardId) {
		this.shardId = shardId;
	}

	public int getRedirectCnt() {
		return redirectCnt;
	}

	public void setRedirectCnt(int redirectCnt) {
		this.redirectCnt = redirectCnt;
	}

	public SearchRequest getSearchRequest() {
		return searchRequest;
	}

	public void setSearchRequest(SearchRequest searchRequest) {
		this.searchRequest = searchRequest;
	}

}
